
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:freedom_flutter_mall/utils/router_utils.dart';
import 'package:freedom_flutter_mall/utils/theme_utils.dart';
import 'package:freedom_flutter_mall/values/color_values.dart';
import 'package:freedom_flutter_mall/views/screens/goods/goods_list_screen.dart';
import 'package:freedom_flutter_mall/views/screens/search/search_screen_bar.dart';
import 'package:freedom_flutter_mall/views/widgets/load_image.dart';
import 'package:freedom_flutter_mall/views/widgets/my_button.dart';

class SearchScreen extends StatefulWidget {

  const SearchScreen({
    super.key,
    this.hintText = '',
    this.backImg = 'assets/images/ic_back_black.png',
    this.onPressed,
  });

  final String backImg;
  final String hintText;
  final void Function(String)? onPressed;

  @override
  State<SearchScreen> createState() => _SearchScreenState();
}

class _SearchScreenState extends State<SearchScreen> {

  late String _keyword;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: SearchScreenBar(
        hintText: '请输入内容',
        onPressed: (text) {
          if (text.isEmpty) {
            return;
          }
          _keyword = text;
          RouterUtils.toPage(context, const GoodsListScreen());
        },
      ),
    );
  }

}

